package f.h.dragon.patterns.money;

/**
 * IMoney: The common interface for simple Monies and MoneyBags
 * 
 * @author Wenlong Meng(wenlong.meng@gmail.com)
 * @version 1.0 at 2012/04/21
 * @since 1.0
 */
public interface IMoney {

	/**
	 * Adds a money to this money.
	 * 
	 * @param m
	 * @return
	 */
	public abstract IMoney add(IMoney m);

	/**
	 * Adds a simple Money to this money. This is a helper method for
	 * implementing double dispatch
	 * 
	 * @param m
	 * @return
	 */
	public abstract IMoney addMoney(Money m);

	/**
	 * Adds a MoneyBag to this money. This is a helper method for implementing
	 * double dispatch
	 * 
	 * @param s
	 * @return
	 */
	public abstract IMoney addMoneyBag(MoneyBag s);

	/**
	 * Tests whether this money is zero
	 * 
	 * @return
	 */
	public abstract boolean isZero();

	/**
	 * Multiplies a money by the given factor.
	 * 
	 * @param factor
	 * @return
	 */
	public abstract IMoney multiply(int factor);

	/**
	 * Negates this money.
	 * 
	 * @return
	 */
	public abstract IMoney negate();

	/**
	 * Subtracts a money from this money.
	 * 
	 * @param m
	 * @return
	 */
	public abstract IMoney subtract(IMoney m);

	/**
	 * Append this to a MoneyBag m.
	 * 
	 * @param m
	 */
	public abstract void appendTo(MoneyBag m);

}
